# 局部变量和全局变量

def fun_01(a):
    b = 1
    c = a + b
    print("a:",a,"b:",b,"c:",c)
# fun_01(2)
# print(a)
# print(b)
# print(c)  # 此处a,b,c都是函数fun_01的局部变量，不能在函数范围外使用

d = 5
e = 6
# print("d:",d,"e:",e)
def fun_02():
    f = 7
    print("f:",f)
# fun_02()
# print(d)
# print(e)

# def fun_03():
#     global d
#     d += 3
#     print(d)
# fun_03()
#
# def fun_04():
#     g = 7
#     h = 8
#     res = g + h
#     print(g,h,res)
#     def fun_05():
#         nonlocal h
#         print(h)
#         def fun_06():
#             nonlocal h
#             print(h)
#         fun_06()
#     fun_05()
#     return res
# res1 = fun_04()
# print(res1)

# sum = lambda a,b:a+b
# print(sum(2,3))
# p = lambda : print("111111111111")
# p()
# list01 = [{'name':'ta','age': 16},
#         {'name':'df','age': 25},
#         {'name':'aa','age': 19}]
# list01.sort(key=lambda a:a['age'])
# for i in list01:
#     print('name:',i['name'],'age:',i['age'])
